package com.atguigu.spring.bean;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class LookupMainTest {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(LookupConfig.class);
		context.scan("com.atguigu.spring.bean");
//		context.refresh();

		Person2 bean2 = context.getBean(Person2.class);
		System.out.println(bean2.getCat());
		System.out.println(bean2.getCat());
		System.out.println(bean2.getCat());

		System.out.println("------------------");

		Person bean = context.getBean(Person.class);
		System.out.println(bean.getCat());
		System.out.println(bean.getCat());
		System.out.println(bean.getCat());

	}

}
